using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;
using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Response.Tables;
using MinimalistFoodStreet.BackEnd.Infrastructure.Tools;

namespace MinimalistFoodStreet.BackEnd.Server.Server.ResponseExtend.Tables 
{
	public static class ErrorLogsEnitityExtend 
	{
		public static ResponseErrorLogsDto ToResponseDto(this ErrorLog entity)
		{
			return new ResponseErrorLogsDto ()
			{

					id = entity.ElId,
					message = entity.ElMessage,
					@params = entity.ElParams,
					url = entity.ElUrl,
					stackTrack = entity.ElStackTrack,
					errorTime = entity.ElErrorTime,
					errorTimeStr = Tools.TimeToString(entity.ElErrorTime),
					createTime = entity.ElCreateTime,
					createTimeStr = Tools.TimeToString(entity.ElCreateTime),
			};
		}
	}
}